import request from '@/utils/request'
// 1.设备管理-表格数据
export const VmSearch = (params) => {
  return request({
    url: '/vm-service/vm/search',
    params
  })
}
// 2.设备管理--批量策略管理下拉数据
export const VmSearchPolicy = () => {
  return request({
    url: '/vm-service/policy'
  })
}
// 3.设备管理修改pl策略管理--确定
export const updataApplyPolicy = (data) => {
  return request({
    url: '/vm-service/vm/applyPolicy',
    method: 'put',
    data
  })
}
// 4.设备管理-新增设备-确定
export const updataEquip = (data) => {
  return request({
    url: '/vm-service/vm',
    method: 'post',
    data
  })
}

// 5.设备管理-新增设备-选择型号
export const typeEquip = (params) => {
  return request({
    url: '/vm-service/vmType/search',
    params
  })
}
// 5.设备管理-新增设备-选择点位
export const nodeEquip = (params) => {
  return request({
    url: '/vm-service/node/search',
    params
  })
}
// 6.设备管理-修改设备
export const updatanodeEquip = (id, nodeId) => {
  return request({
    url: `/vm-service/vm/${id}/${nodeId}`,
    method: 'put'
  })
}
// 7.设备管理设备状态--销售量个数--销售额
export const orderCount = (params) => {
  return request({
    url: '/order-service/report/orderCount',
    params
  })
}
// 销售额
export const orderAmount = (params) => {
  return request({
    url: '/order-service/report/orderAmount',
    params
  })
}
// 补货次数
export const supplyCount = (params) => {
  return request({
    url: `/task-service/task/supplyCount/${params.innerCode}/${params.start}/${params.end}`
  })
}
// 维修次数
// /task-service/task/repairCount
export const repairCount = (params) => {
  return request({
    url: `/task-service/task/repairCount/${params.innerCode}/${params.start}/${params.end}`
  })
}
// 商品销量
export const skuCollect = (params) => {
  return request({
    url: `/order-service/report/skuCollect/${params.innerCode}/${params.start}/${params.end}`
  })
}

// 8.设备管理-设备类型管理
export const vmTypeList = (params) => {
  return request({
    url: '/vm-service/vmType/search',
    params
  })
}

// 9.新增设备类型
export const addvmType = (data) => {
  return request({
    url: '/vm-service/vmType',
    method: 'post',
    data
  })
}
// 10.修改设备类型
export const updatavmType = (data) => {
  return request({
    url: `/vm-service/vmType/${data.typeId}`,
    method: 'put',
    data
  })
}
// 11.货道设置头部
export const GetvmTop = (typeId) => {
  return request({
    url: `/vm-service/vmType/${typeId}`
  })
}
// 12.货道设置-商品列表
export const channelList = (innerCode) => {
  return request({
    url: `/vm-service/channel/channelList/${innerCode}`
  })
}
// 12.智能排序 --销量前10的商品推荐
export const businessTop10 = (businessId) => {
  return request({
    url: `/vm-service/sku/businessTop10/${businessId}`
  })
}
// 13.智能排序--添加--选择商品列表
export const SkuSearch = (params) => {
  return request({
    url: '/vm-service/sku/search',
    params
  })
}
// 14.货道设置--确实
export const channelConfig = (data) => {
  return request({
    url: '/vm-service/channel/channelConfig',
    data,
    method: 'put'
  })
}
// 策略--弹出层
export const vmPolicy = (innerCode) => {
  return request({
    url: `/vm-service/policy/vmPolicy/${innerCode}`
  })
}
// 策略-取消策略
export const cancelPolicy = (data) => {
  return request({
    url: `/vm-service/vm/cancelPolicy/${data.innerCode}/${data.policyId}`,
    method: 'put'
  })
}
